<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
		<title>管理评老师端日报评价页</title>
		<link rel="stylesheet" href="../../css/mui.min.css" />
		<link rel="stylesheet" href="../../css/base.css"/>
		<style type="text/css" media="screen">
			.title {
				font-size: 16px;
			}
			.summary_div .feeling {
				padding-bottom: 1px;
			}
			.feeling {
				border-bottom: 1px solid #ededed;
			}
			.title {
				border-left: unset;
			}
			.bottom_btn_div {
				color: #FFF;
				height: 45px;
				width: 100%;
				z-index: 995;
				border-top: 1px solid #d9d9d9;
				position: fixed;
				bottom: 0px;
				left: 0px;
				text-align: center;
				margin-top: 23px;
			}
			.bottom_btn_div a {
				line-height: 45px;
				font-size: 14px;
				background: #18b4ed;
				width: 100%;
				color: #FFF;
			}
			.content_div {
				margin-top: 66px
			}
			.comment_div {
				padding-right: 20px;
				margin-top: 10px
			}
			.score_div .feeling-text {
				/*text-indent: 2em;*/
				background-size: 16px;
				margin-top: 15px;
				margin: 10px;
			}
			.score_div .feeling-text p {
				color: #646464;
				padding: 2px 2px;
			}
			.score_div {
				padding: 2px 5px;
				background: #fff
			}
			.star_score_div {
				padding: 19px 10px;
				padding-left: 18px;
			}
			.star_score_div	.myScore-starscore .star img {
				margin-left: 1%;
				width: 18px;
			}
			.star {
				width: 53%;
			}
			.title img {
				height: 20px;
				padding-top: 4px
			}
			.summary_title {
				display: inline-block;
				background: url(../../icon/icon_summary_title.png) no-repeat left center;
				background-size: 20px;
				padding-left: 25px
			}
			.comment_title {
				display: inline-block;
				background: url(../../icon/icon_comment_title.png) no-repeat left center;
				background-size: 18px;
				padding-left: 25px
			}
			.grade_title {
				display: inline-block;
				background: url(../../icon/icon_grade_title.png) no-repeat left center;
				background-size: 18px;
				padding-left: 25px
			}
		</style>
	</head>
	<body>
		<div class="base_style_color base_title_Immerse" id='BarAppearance' ></div>
		<div class="base_navigation_bar base_style_color base_navigation_item_bar base_title_position" >
			<a class="base_left_item" href="#" onclick="backClick()"> <img class="base_back_icon" src="../../image/icon_jiantou.png" alt=""> </a>
			<span id="stu_name">张三的月报</span>
			<a class="base_right_item nav-item" id="wancheng"> </a>
		</div>
		<div class=" writeReport content_div">
			<div class="ReviewWeekly_div top_54 summary_div">
				<div class="feeling">
					<p class="title summary_title" >
						工作总结
					</p>
				</div>
				<div class="score_div">
					<div class="feeling-text">
						<p id="summary" style=" word-break: break-all">
							<!--蒙雷亚尔和穆斯塔菲没能将球解围干净，防守中的低级失误让纽卡重新取得领先，自2018年以来，阿森纳在联赛中客场还没有取得过1个积分。从数据端，穆斯塔菲可谓表现抢眼，全场10次头球争顶，可在关键时候，他却屡屡犯错。-->
						</p>
					</div>
				</div>
			</div>
			<div class="ReviewWeekly_div top_10 comment_content_div">
				<div class="feeling" style="padding-bottom: 1px">
					<p class="title comment_title" >
						评语
					</p>
				</div>
				<div class="feeling comment_div">
					<textarea id="comment" style="border:1px solid #d9d9d9;" placeholder='字数不得少于5个字'></textarea>
				</div>
			</div>
			<div class="ReviewWeekly_div top_54 summary_div" style="margin-bottom: 44px">
				<div class="feeling">
					<p class="title grade_title" >
						评分
					</p>
				</div>
				<div class="star_score_div">
					<div class="myScore-starscore clearfix ">
						<div class="star left" id="taiduNum">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png" hidden="hidden">
						</div>
					</div>
				</div>
			</div>
			<div class="bottom_btn_div" id="sub_div" onclick="sumbit()">
				<a>提交</a>
			</div>
		</div>
		<div id="offlineAlert" class="weui_dialog_confirm" style="display: none;">
			<div class="weui_mask"></div>
			<div class="weui_dialog">
				<div class="weui_dialog_hd">
					<strong class="weui_dialog_title">是否放弃在此页面操作？</strong>
				</div>
				<div class="weui_dialog_bd"></div>
				<div class="weui_dialog_ft">
					<a onclick="cleanCancel()" href="#" class="weui_btn_dialog default">取消</a>
					<a onclick="cleanConfirm()" href="#" class="weui_btn_dialog primary"  style="color:#18b4ed">确定</a>
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script src="../../script/jquery.min.js" type="text/javascript"></script>
	<script src="../../script/common.js"></script>
	<script type="text/javascript" src="../../script/base64.min.js"></script>
	<script type="text/javascript">
		var sxtdScore = 0;
		var comment = '';
		var parten = /^\s*$/;
		var stuid = '';
		var id = '';
		var apiready = function() {
			$("#stu_name").text(api.pageParam.rename1 + '的日报');
			$("#summary").text(isString(Base64.decode(api.pageParam.summary)));
			sendBuriedNotifi('0', '老师端日报批改页', '232');
			setupStarClick();
			listenScroll();
		}
		// 滚动监听
		function listenScroll() {
			var winHeight = $(window).height();
			$(window).resize(function() {
				var thisHeight = $(this).height();
				if (winHeight - thisHeight > 50) {
					//当软键盘弹出，在这里面操作
					$("#sub_div").css('display', 'none');
				} else {
					$("#sub_div").css('display', 'block');
					//当软键盘收起，在此处操作
				}
			});
		}

		function sendBuriedNotifi(busionessid, pagetype, pagetypeid) {
			var userinfo = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjid'),
				uname : $api.getStorage('cfnetppusername'),
			}
			var data = {
				busionessid : busionessid,
				pagetype : pagetype,
				pagetypeid : pagetypeid,
				sourceurl : api.pageParam.sourceurl,
				sourcetitle : api.pageParam.sourcetitle,
				accesspageurl : window.location.pathname,
				accesspagetitle : document.title,
				userinfo : userinfo
			}
			SendBehaviorTrajectoriesNotifi_Study(data);
		}

		//提交数据
		function sumbit() {
			var com = $('#comment').val();
			var parten = /^\s*$/;
			if (com.length == 0 || com == null || parten.test(com)) {
				ShowToast('请提交评语');
			} else if (com.length < 5) {
				ShowToast('评语的长度不能小于5个字符');
			} else if (sxtdScore == 0) {
				ShowToast('你还未评分完成，请评分');
			} else {
				showProgress();
				var param = {
					jid : $api.getStorage('cfnetppjid'),
					lsid : $api.getStorage('cfnetppuid'),
					uid : $api.getStorage('cfnetppuid'),
					stuid : api.pageParam.uid,
					dailyid : api.pageParam.weeklyid,
					comments : Base64.encode(com),
					score : sxtdScore//老师评分分数
				};
				cfnetppPOST(urlLsrbevaluate, param, false, function(data, status) {
					SendBusinessOperationsLogNotifi('老师端日报批改', '232', param, param, '', data, '老师端日报批改接口', '232-01')
					hideProgress();
					if (status == 'success') {
						hideProgress();
						if (data.status == 1) {
							api.toast({
								msg : '评价成功',
								duration : 1000,
								location : 'bottom'
							});
							sendNotifi();
							backClick()
						} else {
							ShowToast('提交失败，请重试');
						}
					} else {
						ShowToast('提交失败，请重试');
					}
				});
			}
		}

		function setupStarClick() {
			$('.star img').each(function(i) {
				$(this).click(function() {
					$(this).attr('src', '../../image/icon_xingxingblue.png');
                    $(this).prevAll().attr('src', '../../image/icon_xingxingblue.png');
                    $(this).nextAll().attr('src', '../../image/icon_xingxingblue01.png');
					var score = ($(this).prevAll().length + 1) * 20;
					if ($(this).parent().attr('id') == 'taiduNum') {//实习态度
						sxtdScore = score;
					}
				})
			});
		}

		function backClick() {
			sendBuriedNotifi('1', '老师端日报批改页', '232');
			api.closeWin({
			});
		}

		function sendNotifi() {
			api.sendEvent({
				name : 'TeacherDailyReportList'
			});
		}
	</script>
</html>